home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / mus / play / Play16_1_3.lha / Play16.doc < prev   
Text File  |  1995-02-01  |  15KB  |  353 lines

  1.  
  2. -- Play16 version 1.3 - a versatile soundplayer for the Amiga --
  3.  
  4.  
  5. Features in brief
  6. -----------------
  7.  - autodetects and plays several soundfiles, up to 16 bit / 56 kHz / stereo
  8.  - always correct playback speed, even for sounds >28 kHz
  9.  - realtime playback from harddisk, optimized assembler routines
  10.  - optional 14 bit output (less noise but not as good as true 16 bit)
  11.  - automatic or manual audio filter control
  12.  - plays mono sounds on *both* channels, not only on the left one
  13.  - plays (and loops) files that are larger than memory
  14.  - preloading for exactly timed start of playback
  15.  - fast uLaw decompression
  16.  - system friendly audio channel allocation
  17.  - supported Filetypes are:
  18.  
  19.    * Microsoft RIFF-WAVE  (.WAV)  mono / stereo, 8 / 16 bit, linear / uLaw
  20.    * Sun/NeXT Audio       (.AU)   mono / stereo, 8 / 16 bit, linear / uLaw
  21.    * MacroSystem MAUD     (.MAUD) mono / stereo, 8 / 16 bit, linear
  22.    * Apple/SGI/Amiga AIFF (.AIFF) mono / stereo, 8 / 16 bit, linear
  23.    * Amiga IFF-8SVX       (.IFF)  mono / stereo, 8      bit, linear
  24.    * Any raw sound data as long as it matches one of the following:
  25.      -  8 bit signed
  26.      -  8 bit unsigned
  27.      - 16 bit signed, Intel format    (LSB first)
  28.      - 16 bit signed, Motorola format (MSB first)
  29.  
  30.  
  31. What do I need to use Play16?
  32. -----------------------------
  33. Any Amiga running Kickstart/Workbench 2.04 or greater.
  34.  
  35.  
  36. What does it do?
  37. ----------------
  38. Basically, Play16 is capable of playing uncompressed and _some_ compressed
  39. soundfiles through Amiga's standard audio device. If the actual resolution
  40. or playback rate exceeds that of the Amiga hardware, realtime conversion
  41. is done so that the sound is being played back correctly.
  42.  
  43. You can even play 16 bit / 44.1 kHz sounds, providing all parts of
  44. your system can keep up with the high data transfer rate and lots
  45. of calculations needed for this task. (In this case an accelerated
  46. Amiga is recommended :-)
  47.  
  48. The two audio channels at each side can be linked to perform as a single
  49. 14 bit channel. Again, this swallows lots of computing power.
  50.  
  51. !!! An Amiga 3000-16MHz is fast enough to play an uncompressed soundfile !!!
  52. !!! with full 44.1kHz/14bit output (productivity) directly from harddisk !!!
  53.  
  54. I don't want Play16 to be a program that plays each and every exotic format
  55. that exists somewhere. However, I intend to support as many popular file
  56. types as possible.
  57.  
  58.  
  59. How do I use it?
  60. ----------------
  61. Simply type "Play16 <filename>" and that's it!
  62. All possible options will be explained later. If you set none of them, the
  63. defaults will be used.
  64.  
  65.  
  66. Why Play16?
  67. -----------
  68. 16 bit soundcards are becoming more and more popular, especially on the
  69. PC. The common file format over there is Microsoft's (yuck! :)) RIFF-
  70. WAVE format.
  71. I didn't find any CLI based program to play back 16 bit recordings, on a
  72. standard Amiga, so I decided to write one myself.
  73.  
  74.  
  75. Why CLI based and no GUI?
  76. -------------------------
  77. There are so many GUI based directory utilities, simply use Play16 as an
  78. external player. Consult the manual of your software package on how to
  79. do it. Application example: Assign "Play16 <filename> PRELOAD" to a button
  80. called "Jingle". Select the desired soundfile and press the Jingle-button.
  81. Wait for the appropriate moment and hit the return key - here comes the
  82. sound! Nice when audio dubbing your home videos or even on parties :-)
  83.  
  84.  
  85. How does it work? (technical info)
  86. ----------------------------------
  87. The standard Amiga audio device is limited to 8 bit / 28 kHz playbck
  88. when using DMA. With the introduction of ECS the 28 kHz DMA barrier
  89. was broken - but only if the current displaymode was one with double
  90. scan rate like productivity. The reason for this is the dependency
  91. between video and audio DMA. If you don't have ECS or if you simply
  92. don't want to switch to Productivity just to listen to your desired
  93. sound, Play16 can halve the sample rate during playback. In the
  94. current version of Play16 only 8 bit output is supported so 16 bit
  95. sounds are converted accordingly.
  96.  
  97. To play back even long sounds, the popular method of double buffering
  98. is used. Alternatively, all data can be loaded into memory before
  99. playback. This is useful when playing short sounds or when loading
  100. the sound from floppy disk or slow CD ROM.
  101.  
  102. The 14 bit output is archieved by setting the first channel on each
  103. side to volume 64 and the second to volume 1. The louder channel then
  104. plays the upper 8 bits as usual while the other channel plays the
  105. 6 most significant bits of the low byte synchronously. Because timing
  106. is very crucial in this case it is nessecary to write directly to
  107. hardware registers instead of using the audio.device. This method may
  108. not work on future amiga models if there ever will be any... :-/
  109.  
  110.  
  111.  
  112. What options are provided?
  113. --------------------------
  114. If you are not familiar with the AmigaOS 2.x commandline template, see
  115. the examples below and consult the AmigaOS manual for furhter information.
  116.  
  117. FAST/S      Do not automatically switch to half sample rate if the
  118.             soundfile's rate exceeds 28 kHz. Use this option when
  119.             running your Amiga in Productivity or similar display
  120.             modes.
  121.  
  122. HIFI/S      Turn on the 14 bit output. Watch out! This is a nasty routine
  123.             that writes directly to some hardware registers. I've done
  124.             everything I can to prevent Play16 from interfering with
  125.             other running tasks in this case but you'll never know...
  126.             Use it with care!
  127.  
  128. FILTER/K    FILTER=ON  : Enable audio filter for playback
  129.             FILTER=OFF : Disable audio filter for playback
  130.             FILTER=AUTO: Turn filter on or off depending on sample rate
  131.             If you don't specify this keyword Play16 will leave the
  132.             hardware registers of the audiofilter completely untouched.
  133.  
  134. SINGLE/S    Use only one buffer rather then two and load all data into
  135.             memory befor playback.
  136.  
  137. BUFFER/N    Buffersize in samples. May vary from 32768 to 131072. The
  138.             amount of allocated memory also depends on whether the sound
  139.             is mono or stereo, 8 bit or 16 bit.
  140.             Default is 65536 samples, values are rounded to multiples of
  141.             32768.
  142.             Note that it is useless to modify this value when in single
  143.             buffer mode :)
  144.  
  145. VERBOSITY/N Sets the level of verbosity.
  146.             0: Just display the banner and error messages
  147.             1: Print additional information about the sound file,
  148.                allocated memory, etc.
  149.             2: Progress information
  150.             3: Debugging information (may look a bit weird :)
  151.             Default is level 0.
  152.  
  153. LOOPS/N     Determines the number of loops to be played.
  154.             Default is 1 loop. (Play the sound once.)
  155.             This option is not yet supported in SINGLE mode.
  156.  
  157. PRELOAD/S   Load enough data into memory for immediate start of playback
  158.             at a keypress
  159.  
  160. RAW/S       Disable autodetect and tell Play16 what the actual format of
  161.             the sound data is.
  162.             However, if Play16 can't detect the filetype it will switch
  163.             to RAW mode automatically. If you don't want this to happen
  164.             you can specify...
  165.  
  166. STRICT/S    Play only files that are supported by the autodetect routine
  167.  
  168. The following options tell Play16 what parameters to use when in RAW mode.
  169. This happens either if you set the RAW keyword or if Play16 could not
  170. identify the file and STRICT was _not_ set.
  171.  
  172. FREQ/N      Sampling frequency in Hz
  173. TRACKS/N    Number of tracks, 1 for mono, 2 for stereo
  174. BITS/N      Resolution in bits, may be 8 or 16
  175. HEADER/N    Length of header: This is the number of bytes to be skipped
  176.                               at the beginning of the file.
  177. UNSIGNED/S  Data is unsigned, not signed (only valid for  8 bit sounds)
  178. INTEL/S     Data is in Intel format      (only valid for 16 bit sounds)
  179. ULAW/S      Data is compressed using the uLaw compression scheme
  180.  
  181. The default settings are: 22050 Hz, mono, 8 bits, no header.
  182.  
  183. Examples:
  184.  
  185. a) Play16 music.wav
  186.     Simply play the file called music.wav once and directly from harddisk.
  187.  
  188. b) Play16 music.wav SINGLE
  189.     Same as above but load all data into memory before playback. Use this
  190.     when loading soundfiles from floppy disk.
  191.  
  192. c) Play16 music.wav SINGLE VERBOSITY=1
  193.     Same as b, but with additional information being printed out.
  194.  
  195. d) Play16 rhythm.wav LOOPS=10
  196.         Play the rhythm as a continuous loop, i.e. over and over again (10 times)
  197.  
  198. e) Play16 explosion.wav SINGLE PRELOAD
  199.     Load the complete explosion sound into memory, then wait for you to hit
  200.     <return> before playback.
  201.  
  202.  
  203. How do I use this RAW mode?
  204. ---------------------------
  205. Umm, err, difficult to explain, even harder to understand...
  206. Well, if you know the data format of the soundfile, simply set RAW, FREQ,
  207. TRACKS, BITS, UNSIGNED and INTEL accordingly. If you don't, the only
  208. way to find it out is by trial and error :) Here are some tips to make
  209. it a bit easier:
  210.  
  211. Don't set HEADER to an odd number. (Leave it at 0, first.)
  212. If you set BITS to 16 and hear nothing but noise, try to set INTEL.
  213. If you set BITS to 8 and the sound is distorted, try to set UNSIGNED.
  214. If the above does not help, try different combinations of BITS, INTEL
  215. and UNSIGNED.
  216.  
  217. If you manage to get a recognisable sound output which is either too
  218. fast or too slow, start experimenting on TRACKS and FREQ.
  219.  
  220. If you want to play known files and raw ones without changing the command
  221. line, simply specify all you know about the raw data and leave out the
  222. RAW and the STRICT keyword. If Play16 can indentify the file it will use
  223. its parameters. If the filetype is unknown your specified parameters will
  224. be used instead.
  225.  
  226. Legal stuff
  227. -----------
  228. Play16 is copyrighted freeware. It may be distributed freely as long as
  229. no modifications are made to the executable and this document. A nominal
  230. fee may be asked to cover distribution costs.
  231.  
  232. Play16 may not be used for any commercial purposes or included with any
  233. commercial product without the written permission of the author.
  234.  
  235. No responsibilities are taken for damaged speakers, amplifiers, Amigas
  236. or any other components or data involved while using Play16.
  237.  
  238. Although I've done some beta testing I can't guarantee that Play16 will
  239. not crash! If you find any bugs, let me know.
  240.  
  241.  
  242. Miscellaneous
  243. -------------
  244. I don't claim Play16 to be fast. I've done some optimizing - but because
  245. the loader/converter module is a universial one, more data is actually
  246. being moved around different memory blocks than needed for playback.
  247. I've implemented separate optimized routines for 8 bit and 14/16 bit.
  248. This method will provide the basis for future enhancements in the playback
  249. routine like soundcard support.
  250.  
  251. * Please note that English is not my native language :)
  252.  
  253. I can be reached at...
  254.  
  255. Internet: wenzel@unixserv.rz.fh-hannover.de (preferred)
  256.           Thomas_Wenzel@aventure.fido.de
  257. Fido:     2:243/6050.28 or 2:241/1035.6
  258.           Mail routing _is_sometimes_ unreliable in FidoNet :-(
  259.  
  260. If you use this program, please send me a mail. I'd like to know how many
  261. people are interested in it at all.
  262.  
  263.  
  264. History
  265. -------
  266. V0.5ß   - Initial beta test release
  267.  
  268. V0.6ß   - Optimized the code a bit.
  269.  
  270. V0.7ß   - Fixed some severe bugs that caused Play16 to crash when trying
  271.           to load corrupted files.
  272.  
  273. V0.8ß   - Play16 can now be stopped by pressing ctrl-c during playback. The
  274.           buffer that is currently being played will be finished first.
  275.         - Automatic filter control depending on sample rate.
  276.  
  277. V0.9ß   - Added 'loop'-option. Sample can be played several times.
  278.         - All time consuming routines now in hand optimized assembler code.
  279.  
  280. V1.0ß   - Play16 now uses standard OS2.x commandline template.
  281.           Thanks to Kai for persuading me to do this :)
  282.  
  283. V1.0    - Done some minor bugfixes.
  284.  
  285. V1.1    - Oops! Play16 caused some Enforcer hits. Fixed that.
  286.           Thanks to Rod Schnell for reporting it.
  287.         - Added 'single'-option. Sound can be loaded completely into memory
  288.           before playing. No looping possible in this case yet!
  289.         - Playback time in minutes:seconds displayed if verbose >= 1
  290.         - uLaw decompression for WAVE-Files, using a decoding table
  291.           for maximum speed (didn't do much testing on it, hope it works!)
  292.         - MAUD filetype support (why do there have to be so many formats?)
  293.         - AIFF filetype support
  294.           Note that the AIFF sounds saved with MacroSystem's MPro software
  295.           contain a corrupt ANNO chunk :-/
  296.           Play16 will detect this and play the file anyway.
  297.         - ctrl-c now stops playback immediately.
  298.           Thanks to Marc for some programming tips about that.
  299.  
  300. V1.2    - IFF-8SVX filetype support (only uncompressed files!)
  301.         - RAW data support: _Any_ data can be played
  302.         - Preload feature added
  303.         - Fixed a bug that caused illegal memory access (hopefully)
  304.           Thanks to Ignatios Souvatzis for reporting it.
  305.         - Improved chunk handling
  306.  
  307. V1.3    - 14 bit output (finally!)
  308.         - Any file Play16 can't recognise is considered raw data unless
  309.           you set the STRICT keyword
  310.         - Fixed a bug in WAV filetype length determination
  311.         - Advanced audiofilter control / original state will be restored
  312.           after playback
  313.         - More information about sound (AUTHOR or ANNO-Chunk) is being
  314.           printed out if VERBOSE>=1. However, Play16 will *not* search
  315.           the whole file for that string. If it doesn't come before the
  316.           sound data -- bad luck :-)
  317.  
  318. Future plans
  319. ------------
  320. - Wildcard support (!)
  321. - Filerequester if no filename is given
  322. - Workbench icon with tooltype entries
  323. - Settings can be stored in environment variables
  324.   (espacially useful for filter setting)
  325. - Stop playing by ctrl-c _or_ lmb
  326. - other uLaw-formats and almost certainly Creative-VOC support
  327. - Samplitude HDPs and RAPs
  328. - ADPCM decompression (still having difficulties coding the algorhytm)
  329. - some of the file types saved by Macintosh software (e.g. Sound-Designer)
  330. - Soundcard support
  331.  
  332. Known bugs
  333. ----------
  334. Some files have additional information stored AFTER the waveform data.
  335. Play16 does not recognise that and tries to play the data, resulting
  336. in a short 'blip' at the end of the sound. So far I've only encountered
  337. *some* WAVs that have this additional chunk at the end of the file.
  338.  
  339. Credits
  340. -------
  341. Thanks go to the following persons:
  342.  
  343. Kai Stuke   for many vital hints on C programming and the Amiga
  344.             audio device.
  345.             for beta testing this program.
  346.  
  347. Marc Führer for doing some beta testing as well.
  348.             for some hints on optimizing the code.
  349.  
  350. Clete Baker for supplying the AIFF- and SDII specs.
  351.  
  352. And to all the people who wrote me!
  353.